package com.asialjim.wechat.message;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlCData;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import lombok.Data;
import java.io.Serializable;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>CLASS DESCRIPTION <i>[ NAME: BaseWeChatMessage ]</i></h2><strong>
 * <p> the base we chat message
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/1/26   &nbsp;&nbsp; JDK 8
 */
@Data
public abstract class BaseWeChatMessage implements WeChatMessage, Serializable {

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * name (openId) of user who receive message
     */
    @JacksonXmlCData
//    @JsonProperty(value = "ToUserName")
    @JacksonXmlProperty(localName = "ToUserName")
    protected String toUserName;

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * name (openId) of user who send message
     */
    @JacksonXmlCData
//    @JsonProperty(value = "FromUserName")
    @JacksonXmlProperty(localName = "FromUserName")
    protected String fromUserName;

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * create time of we chat message
     */
//    @JsonProperty(value = "CreateTime")
    @JacksonXmlProperty(localName = "CreateTime")
    protected Long createTime;

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * message type of we chat message
     */
    @JacksonXmlCData
//    @JsonProperty(value = "MsgType")
    @JacksonXmlProperty(localName = "MsgType")
    protected String msgType;
}